<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- 引入 ECharts 文件 -->
<script src="../plugins/echarts/echarts.js"></script>
<script src="../plugins/jquery/jquery-3.1.1.js"></script>
<script src="../js/chartUtils.js"></script>
</head>
<body>

	<script type="text/javascript">
	function getFund(){
		var s = document.getElementById("fundCode");
		getFundByCode('fundAnalysisController?action=1',s.options[s.selectedIndex].value );
	}
	function getFundMin(){
		fundMin('fundAnalysisController?action=4');
	}
	function getRandomFund(){
		var s = document.getElementById("fundCode");
		var length = s.length;
		var n = document.getElementById("rd").value;
		var r;
		for(var i=0;i<n;i++){
			r = Math.floor(Math.random()*length);
			getFundByCode('fundAnalysisController?action=1',s.options[r].value);
		}
	}
		$.ajax({
			type : "GET",
			url : projectName + "/fundAnalysisController",
			data : {
				action : 2
			},
			dataType : "json",
			success : function(result, status) {
				var s = document.getElementById("fundCode");
				for (var i = 0; i < result.length; i++) {
					s.options.add(new Option(result[i].fundName, result[i].fundCode));
				}
			}
		});
	</script>
	<form>
		<select id="fundCode"></select> <input type="text" id="rd" name="rd"
			value="2" /> <input type="button" onclick="getFund()" value="查询选中基金">
		<input type="button" onclick="getRandomFund()" value="随机查询n个基金">
		<input type="button" onclick="getFundMin()" value="基金净值排名">
	</form>
</body>
</html>